/********************************************************/
/*	Copyright (C) 2012 Gong Li Bin			*/
/*	Project:	MapReduce			*/
/*	Author:		gong_libin			*/
/*	Date:		2013_05_06			*/
/*	File:		MrMysql.h			*/
/********************************************************/

#ifndef	_MRMYSQL_H
#define	_MRMYSQL_H

#include "MrSql.h"
#include <mysql.h>

class CMrMysql : public CMrSql
{
public:
	CMrMysql();
	virtual ~CMrMysql();

	char* MrMysqlError();
	void MrMysqlFree(void* pResult);

	void MrSqlClose();
	int MrSqlInsert(char* pszSql);
	int MrSqlUpdate(char* pszSql);
	int MrSqlDelete(char* pszSql);
	void* MrSqlSelect(char* pszSql);
	int MrSqlConnect(char* pszHost, char* pszPort, char* pszUser, char* pszPass);

protected:
	MYSQL m_stMysql;

private:
	int MrMysqlQuery(char* pszSql);

};

#endif /* _MRMYSQL_H */
